<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .HolyGrail {
            display: flex;
            min-height: 100vh;
            flex-direction: column;
        }

        header,
        footer {
            flex: 0 0 100px;
        }

        header {
            width: 100%;

            background-color: aqua;
        }

        footer {
            width: 100%;
            background-color: blueviolet;
        }

        .HolyGrail-body {
            display: flex;
            flex: 1;
            flex-wrap: wrap;
        }

        .HolyGrail-content {
            background-color: blue;
            flex: 1 0 60%;
        }

        .HolyGrail-nav {
            background-color: brown;
            order: -1;
            flex: 1;
        }

        @media (max-width: 800px) {
            .HolyGrail-body>.HolyGrail-ads {
                flex-direction: column;
                flex: 1;
            }

            /* .HolyGrail-nav,
            .HolyGrail-content {
                flex: 1;
            } */
        }

        .HolyGrail-ads {
            flex: 1 0 auto;
            background-color: bisque;
        }

        /* .HolyGrail-nav,
        .HolyGrail-ads,
        .HolyGrail-content {
            flex: auto;
        } */
    </style>
</head>

<body class="HolyGrail">
    <header>header</header>
    <div class="HolyGrail-body">
        <main class="HolyGrail-content">countent</main>
        <nav class="HolyGrail-nav">nav</nav>
        <aside class="HolyGrail-ads">ads</aside>
    </div>

    <footer>footer</footer>
</body>

</html>